﻿using System;
using Aliyun.OSS.Common;

namespace Aliyun.OSS.Samples
{
    internal class Config
    {
        public static string AccessKeyId = "LTAIS8N6dUnTV2sS";

        public static string AccessKeySecret = "pFSVugeZyj6ecpH1u7YejlWtWWsUvN";

        public static string Endpoint = "oss-cn-hangzhou.aliyuncs.com";

        /// <summary>
        /// 默认存储空间
        /// </summary>
        public static string BucketName = "publicdata"; 

        public static string DirToDownload = "<your local dir to download file>";

        public static string FileToUpload = "<your local file to upload>";

        public static string BigFileToUpload = "<your local big file to upload>";
        public static string ImageFileToUpload = "<your local image file to upload>";
        public static string CallbackServer = "<your callback server uri>";


        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="accessKeyId">账号</param>
        /// <param name="accessKeySecret">密码</param>
        /// <param name="endpoint">云服务地址</param>
        /// <param name="bucketName">（默认1个）存储空间</param>
        public static void Ini(string accessKeyId, string accessKeySecret, string endpoint, string bucketName)
        {
            //默认存储空间
            if (!string.IsNullOrEmpty(bucketName))
            {
                Config.BucketName = bucketName;
            }

            Ini(accessKeyId, accessKeySecret, endpoint);
        }

        public static void Ini(string accessKeyId, string accessKeySecret, string endpoint)//, string bucketName)
        {
            Config.AccessKeyId = accessKeyId;
            Config.AccessKeySecret = accessKeySecret;
            Config.Endpoint = endpoint;

            //Config.DirToDownload = @"D:\张睿\OSS\WebAppOSS\DownLoads";
            //Config.FileToUpload = @"D:\张睿\OSS\WebAppOSS\FileToUpload\123.jpg";

            //Config.BigFileToUpload = "<your local big file to upload>";
            //Config.ImageFileToUpload = "<your local image file to upload>";
            //Config.CallbackServer = "<your callback server uri>";
        }
    }
}